package com.atguigu.test2;

/**
 * @author 路飞
 * @date 2024/3/28 11:11
 * @description 18、用实现Runnable接口的方式，启动一个线程完成在线程中打印1-100的数字
 */
public class Exer18 {
    public static void main(String[] args) {
        new Thread(new MyThread()).start();
    }
}

class MyThread implements Runnable {

    @Override
    public void run() {
        for (int i = 1; i <= 100; i++) {
            System.out.println(i);
        }
    }
}
